3fbd0a42l40lM0IICw2jXbQBVZSdZg tools/xc/py/Xc.c
3fbd4bd6GtGwZGxYUJPOheYIR7bPaA tools/xc/py/XenoUtil.py
3fbd0a40yT6G3M9hMpaz5xTUdl0E4g tools/xc/py/setup.py
+40431ac64Hj4ixUnKmlugZKhXPFE_Q tools/xend/Makefile
+40431ac8wrUEj-XM7B8smFtx_HA7lQ tools/xend/xend.c
403a3edbrr8RE34gkbR40zep98SXbg tools/xentrace/Makefile
403a3edbVpV2E_wq1zeEkJ_n4Uu2eg tools/xentrace/xentrace.c
403a3edb0lzD0Fojc-NYNoXr3SYrnA tools/xentrace/xentrace_cpusplit.py
$(MAKE) -C misc
$(MAKE) -C examples
$(MAKE) -C xentrace
+ $(MAKE) -C xend
install: all
$(MAKE) -C balloon install
$(MAKE) -C misc install
$(MAKE) -C examples install
$(MAKE) -C xentrace install
+ $(MAKE) -C xend install
dist: all
$(MAKE) -C balloon dist
$(MAKE) -C misc dist
$(MAKE) -C examples dist
$(MAKE) -C xentrace dist
+ $(MAKE) -C xend dist
clean:
$(MAKE) -C balloon clean
$(MAKE) -C examples clean
$(MAKE) -C nsplitd clean
$(MAKE) -C xentrace clean
+ $(MAKE) -C xend clean
/******************************************************************************
* balloon.c
*
- * Xeno balloon driver userspace control tool. Used to shrink/grow domain's
+ * Xen balloon driver userspace control tool. Used to shrink/grow domain's
* memory.
*
* Copyright (c) 2003, B Dragovic
static int open_balloon_proc()
{
- return open("/proc/xeno/balloon", O_RDWR);
+ return open("/proc/xen/balloon", O_RDWR);
}
/* inflate balloon function signals to kernel it should relinquish memory */
/*
* User mode program to prod MSR values through /proc/perfcntr
- *
- *
- * $Id$
- *
- * $Log$
*/
#include <sys/types.h>
}
}
- if ( (privfd = open("/proc/xeno/privcmd", O_RDWR)) == -1 )
+ if ( (privfd = open("/proc/xen/privcmd", O_RDWR)) == -1 )
{
fprintf(stderr, "Could not open privileged Xen control interface.\n");
exit(1);
errno = 2;
errexit("daemon");
} else {
- openlog("xenolog", LOG_PID, SYSLOGTO);
+ openlog("xen_log", LOG_PID, SYSLOGTO);
}
break;
case 'h':
- printf("Usage: xenolog [options]\n");
+ printf("Usage: xen_log [options]\n");
printf("Capture and display output of xen domains.\n\n");
printf(" -d Daemonize and send output to syslog.\n");
exit(0);
int xc_interface_open(void)
{
- int fd = open("/proc/xeno/privcmd", O_RDWR);
+ int fd = open("/proc/xen/privcmd", O_RDWR);
if ( fd == -1 )
PERROR("Could not obtain handle on privileged command interface");
return fd;
is expressed as a textual dotted quad, and set up appropriate routing
rules in Xen. No return value.
"""
- fd = os.open( '/proc/xeno/vfr', os.O_WRONLY )
+ fd = os.open( '/proc/xen/vfr', os.O_WRONLY )
if ( re.search( '169\.254', addr) ):
os.write( fd, 'ADD ACCEPT srcaddr=' + addr +
' srcaddrmask=255.255.255.255' +
--- /dev/null
+
+CC = gcc
+CFLAGS = -Wall -O3
+CFLAGS += -I../../xen/include -I../../xenolinux-sparse/include
+
+HDRS = $(wildcard *.h)
+OBJS = $(patsubst %.c,%.o,$(wildcard *.c))
+
+BIN = xend
+
+all: $(BIN)
+
+install: all
+ mkdir -p /usr/sbin
+ cp $(BIN) /usr/sbin
+ chmod 755 /usr/sbin/$(BIN)
+
+dist: all
+ mkdir -p ../../../install/sbin
+ cp $(BIN) ../../../install/sbin
+ chmod 755 ../../../install/sbin/$(BIN)
+
+clean:
+ $(RM) *.a *.so *.o *.rpm $(BIN)
+
+$(BIN): $(OBJS)
+ $(CC) $(CFLAGS) -o $@ $^ -L../xc/lib -lxc
+
+%.o: %.c $(HDRS) Makefile
+ $(CC) $(CFLAGS) -c -o $@ $<
--- /dev/null
+/******************************************************************************
+ * xend.c
+ *
+ * The grand Xen daemon. For now it's just a console concentrator.
+ *
+ * Copyright (c) 2004, K A Fraser
+ */
+
+int main(int argc, char **argv)
+{
+ return 0;
+}
#define PORT_DISCONNECT 0x8000
#define PORTIDX_MASK 0x7fff
-/* /dev/xeno/evtchn resides at device number major=10, minor=200 */
+/* /dev/xen/evtchn resides at device number major=10, minor=200 */
#define EVTCHN_MINOR 200
-/* /dev/xeno/evtchn ioctls: */
+/* /dev/xen/evtchn ioctls: */
/* EVTCHN_RESET: Clear and reinit the event buffer. Clear error condition. */
#define EVTCHN_RESET _IO('E', 1)
-/* NB. This must be shared amongst drivers if more things go in /dev/xeno */
-static devfs_handle_t xeno_dev_dir;
+/* NB. This must be shared amongst drivers if more things go in /dev/xen */
+static devfs_handle_t xen_dev_dir;
-/* Only one process may open /dev/xeno/evtchn at any time. */
+/* Only one process may open /dev/xen/evtchn at any time. */
static unsigned long evtchn_dev_inuse;
-/* Notification ring, accessed via /dev/xeno/evtchn. */
+/* Notification ring, accessed via /dev/xen/evtchn. */
#define RING_SIZE 2048 /* 2048 16-bit entries */
#define RING_MASK(_i) ((_i)&(RING_SIZE-1))
static u16 *ring;
static unsigned int ring_cons, ring_prod, ring_overflow;
-/* Processes wait on this queue via /dev/xeno/evtchn when ring is empty. */
+/* Processes wait on this queue via /dev/xen/evtchn when ring is empty. */
static DECLARE_WAIT_QUEUE_HEAD(evtchn_wait);
static struct fasync_struct *evtchn_async_queue;
add_wait_queue(&evtchn_wait, &wait);
- if ( (count <= 0) || (count > PAGE_SIZE) || ((count&1) != 0) )
+ count &= ~1; /* even number of bytes */
+
+ if ( count == 0 )
{
- rc = -EINVAL;
+ rc = 0;
goto out;
}
+ if ( count > PAGE_SIZE )
+ count = PAGE_SIZE;
+
for ( ; ; )
{
set_current_state(TASK_INTERRUPTIBLE);
if ( kbuf == NULL )
return -ENOMEM;
- if ( (count <= 0) || (count > PAGE_SIZE) || ((count&1) != 0) )
+ count &= ~1; /* even number of bytes */
+
+ if ( count == 0 )
{
- rc = -EINVAL;
+ rc = 0;
goto out;
}
+ if ( count > PAGE_SIZE )
+ count = PAGE_SIZE;
+
if ( copy_from_user(kbuf, buf, count) != 0 )
{
rc = -EFAULT;
return err;
}
- /* (DEVFS) create directory '/dev/xeno'. */
- xeno_dev_dir = devfs_mk_dir(NULL, "xeno", NULL);
+ /* (DEVFS) create directory '/dev/xen'. */
+ xen_dev_dir = devfs_mk_dir(NULL, "xen", NULL);
/* (DEVFS) &link_dest[pos] == '../misc/evtchn'. */
pos = devfs_generate_path(evtchn_miscdev.devfs_handle,
if ( pos >= 0 )
strncpy(&link_dest[pos], "../", 3);
- /* (DEVFS) symlink '/dev/xeno/evtchn' -> '../misc/evtchn'. */
- (void)devfs_mk_symlink(xeno_dev_dir,
+ /* (DEVFS) symlink '/dev/xen/evtchn' -> '../misc/evtchn'. */
+ (void)devfs_mk_symlink(xen_dev_dir,
"evtchn",
DEVFS_FL_DEFAULT,
&link_dest[pos],
struct proc_dir_entry *create_xeno_proc_entry(const char *name, mode_t mode)
{
if ( xeno_base == NULL )
- if ( (xeno_base = proc_mkdir("xeno", &proc_root)) == NULL )
- panic("Couldn't create /proc/xeno");
+ if ( (xeno_base = proc_mkdir("xen", &proc_root)) == NULL )
+ panic("Couldn't create /proc/xen");
return create_proc_entry(name, mode, xeno_base);
}